package com.qcrud.generic;

import java.lang.reflect.Type;

public abstract class GenericType<T> {
    private final Type type;

    protected GenericType() {
        this.type = GenericTypes.findGenericParameter(getClass(), GenericType.class)
                .orElseThrow(() -> new UnsupportedOperationException("Missing generic type parameter."));
    }

    public final Type getType() {
        return type;
    }
}
